package com.mingdao.lhy.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mingdao.lhy.mapper.wish.ArtSpecialtySignUpMapper;
import com.mingdao.lhy.mapper.wish.MiddleSchoolMapper;
import com.mingdao.lhy.mapper.wish.SignUpStudentMapper;
import com.mingdao.lhy.mapper.wish.ZkwMapper;
import com.mingdao.lhy.pojo.Zkw;
import com.mingdao.lhy.pojo.page.ArtSpecialtySignUp;

@Service
public class ZkwServiceImpl implements ZkwService {

	private static Logger log = LoggerFactory.getLogger(ZkwServiceImpl.class);

	@Autowired
	private ZkwMapper zkwMapper;

	@Autowired
	private SignUpStudentMapper signUpStudentMapper;

	@Autowired
	private MiddleSchoolMapper middleSchoolMapper;

	@Autowired
	private ArtSpecialtySignUpMapper artSpecialtySignUpMapper;

	/**
	 * 根据学校代码返回学校信息
	 */
	@Override
	public Zkw getZkwById(String userid) {
		Zkw zkw = zkwMapper.getOne(userid);
		return zkw;
	}

	@Override
	public int changePassword(Zkw zkw) {
		int result = zkwMapper.updatePasswordByPrimaryKey(zkw);
		return result;
	}

	@Override
	public List<ArtSpecialtySignUp> getAllWishedStudentArtSpecialtyYt(String bmh) {
		Map<String, String> map = new HashMap<String, String>();
		map.put("bmh", bmh);
		List<ArtSpecialtySignUp> students = artSpecialtySignUpMapper.getAllWishedStudentArtSpecialtyYt(map);
		return students;
	}

	@Override
	public List<ArtSpecialtySignUp> getAllWishedStudentArtSpecialtyTs(String bmh) {
		Map<String, String> map = new HashMap<String, String>();
		map.put("bmh", bmh);
		List<ArtSpecialtySignUp> students = artSpecialtySignUpMapper.getAllWishedStudentArtSpecialtyTs(map);
		return students;
	}

	@Override
	public List<ArtSpecialtySignUp> getAllWishedStudentArtSpecialtyByHighSchoolYt(String highSchoolId) {
		Map<String, String> map = new HashMap<String, String>();
		map.put("highSchoolId", highSchoolId);
		List<ArtSpecialtySignUp> students = artSpecialtySignUpMapper.getAllWishedStudentArtSpecialtyByHighSchoolYt(map);
		return students;
	}

	@Override
	public List<ArtSpecialtySignUp> getAllWishedStudentArtSpecialtyByHighSchoolTs(String highSchoolId) {
		Map<String, String> map = new HashMap<String, String>();
		map.put("highSchoolId", highSchoolId);
		List<ArtSpecialtySignUp> students = artSpecialtySignUpMapper.getAllWishedStudentArtSpecialtyByHighSchoolTs(map);
		return students;
	}
	// @Override
	// public int updateArtSpecialtyExamineByBmhYt(String bmh) {
	// int result = artSpecialtySignUpMapper.updateArtSpecialtyExamineByBmhYt(bmh);
	// return result;
	// }
	//
	// @Override
	// public int updateArtSpecialtyCancelExamineByBmhYt(String bmh) {
	// int result =
	// artSpecialtySignUpMapper.updateArtSpecialtyCancelExamineByBmhYt(bmh);
	// return result;
	// }

	@Override
	public int updateArtSpecialtyShztYt(ArtSpecialtySignUp artSpecialtySignUp) {
		int result = artSpecialtySignUpMapper.updateByPrimaryKeySelectiveYt(artSpecialtySignUp);
		return result;

	}

	@Override
	public int updateArtSpecialtyShztTs(ArtSpecialtySignUp artSpecialtySignUp) {
		int result = artSpecialtySignUpMapper.updateByPrimaryKeySelectiveTs(artSpecialtySignUp);
		return result;

	}
}
